import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";


@Entity("role")
export class RoleEntity {

	@PrimaryGeneratedColumn({
		type: "int",
		name: "id"
	})
	id: number;


	@Column("varchar", {
		nullable: false,
		length: 50,
		name: "uuid"
	})
	uuid: string;


	@Column("varchar", {
		nullable: false,
		unique: true,
		length: 50,
		name: "title"
	})
	title: string;


	@Column("varchar", {
		nullable: true,
		length: 100,
		name: "description"
	})
	description: string | null;


	@Column("tinyint", {
		nullable: true,
		default: () => "'1'",
		name: "status"
	})
	status: number | null;


	@Column("timestamp", {
		nullable: false,
		default: () => "CURRENT_TIMESTAMP",
		name: "created_at"
	})
	createdAt: Date;


	@Column("timestamp", {
		nullable: false,
		default: () => "CURRENT_TIMESTAMP",
		name: "updated_at"
	})
	updatedAt: Date;

}
